package pe.com.cruzdelsur.dominio;

// Generated 02/08/2014 12:56:06 PM by Hibernate Tools 4.0.0

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Plantilla generated by hbm2java
 */
@Entity
@Table(name = "PLANTILLA")
public class Plantilla implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int plantillaId;
	private String descripcion;
	private String regimen;
	private String unidadRegimen;
	private Set<UnidadVehicular> unidadVehiculars ;
	private Set<PlantillaDetalle> plantillaDetalles;
	private String estado;

	public Plantilla() {
	}

	public Plantilla(int plantillaId) {
		this.plantillaId = plantillaId;
	}



	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "PLANTILLA_ID", unique = true, nullable = false)
	public int getPlantillaId() {
		return this.plantillaId;
	}

	public void setPlantillaId(int plantillaId) {
		this.plantillaId = plantillaId;
	}

	@Column(name = "DESCRIPCION", length = 100)
	public String getDescripcion() {
		return this.descripcion;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	@Column(name = "REGIMEN", length = 1)
	public String getRegimen() {
		return this.regimen;
	}

	public void setRegimen(String regimen) {
		this.regimen = regimen;
	}

	@Column(name = "UNIDAD_REGIMEN", length = 1)
	public String getUnidadRegimen() {
		return this.unidadRegimen;
	}

	public void setUnidadRegimen(String unidadRegimen) {
		this.unidadRegimen = unidadRegimen;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "PLANTILLA_UNIDAD_VEHICULAR", joinColumns = { @JoinColumn(name = "PLANTILLA_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "UNIDAD_VEHICULAR_ID", nullable = false, updatable = false) })
	public Set<UnidadVehicular> getUnidadVehiculars() {
		return unidadVehiculars;
	}

	public void setUnidadVehiculars(Set<UnidadVehicular> unidadVehiculars) {
		this.unidadVehiculars = unidadVehiculars;
	}



	@OneToMany(fetch = FetchType.LAZY, mappedBy = "plantilla",  cascade = CascadeType.ALL)
	public Set<PlantillaDetalle> getPlantillaDetalles() {
		return plantillaDetalles;
	}



	public void setPlantillaDetalles(Set<PlantillaDetalle> plantillaDetalles) {
		this.plantillaDetalles = plantillaDetalles;
	}

	@Column(name = "ESTADO", length = 1)
	public String getEstado() {
		return estado;
	}

	public void setEstado(String estado) {
		this.estado = estado;
	}
	
	

}
